package com.test.demo;

import java.util.Scanner;

/**
 * @author Douweiwei
 * @createTime 2020年07月07日 16:13:00
 */

public class Factorial {
    public void Recursion() {
        Scanner s = new Scanner(System.in);
        System.out.println("请输入数字：");
        int i = s.nextInt();
        int n = i;
        while (n > 1) {
            --n;
            i *= n;
        }
        System.out.println("阶乘的乘积为：" + i);
    }
}
